package cn.wolfcode.luowowo.search.template;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Document(indexName = "luowowo_goldproduct", type = "goldproduct")
@Getter
@Setter
public class GoldProductTemplate implements Serializable {
    public static final String INDEX_NAME = "luowowo_goldproduct";
    public static final String TYPE_NAME = "goldproduct";


    //@Field 每个文档的字段配置（类型、是否分词、是否存储、分词器 ）
    @Id
    @Field(store = true, index = true, type = FieldType.Long)
    private Long id;  //商品id


    @Field(store = true, index = true, type = FieldType.Long)
    private Long typeId;  //游记地点
    @Field(index=true,store=true,type = FieldType.Keyword)
    private String typeName; //游记地点名称
    @Field(store = true, index = true, type = FieldType.Long)
    private Long parentTypeId;  //游记地点
    @Field(index=true,store=true,type = FieldType.Keyword)
    private String parentTypeName; //游记地点名称
    @Field(index = true, analyzer = "ik_max_word", store = true, searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String productName;  //游记标题
    @Field(index = true, analyzer = "ik_max_word", store = true, searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String subTitle; //游记简介
    @Field(store = true, index = true, type = FieldType.Integer)
    private int convertGoldNum;  //游记查看数
    @Field(store = true, index = true, type = FieldType.Integer)
    private int actualPrice;  //游记查看数
    @Field(store = true, index = true, type = FieldType.Integer)
    private int originalPrice;  //游记查看数
    @Field(store = true, index = true, type = FieldType.Integer)
    private int salesNum;  //游记查看数
    @Field(index=true,store=true,type = FieldType.Keyword)
    private String coverUrl;


}